home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
strtup15.arc
/
STARTUP.DOC
< prev
next >
Wrap
Text File
|
1988-03-31
|
20KB
|
487 lines
.......................................................
/ : \
: STARTUP.PRG : Batch Startup Program Version 1.5 :
: : by Murray Levine :
: : CIS # 74435,1015 :
: : GENIE ID - MURRAY :
\................:....................................../
STARTUP.PRG is a Batch Startup program that executes commands
from the file startup.inf upon booting your ST. STARTUP.PRG must be placed
in the \AUTO\ folder the on boot drive (usually A). STARTUP.PRG now loads
and runs STARTUP.TOS in order keep the memory less fragmented when loading
memory-resident programs like hard drive drivers and ram disks. You'll notice
about a 15K difference if using the FREERAM accessory. It is also possible
to run just the STARTUP.TOS program by changing it's name to STARTUP.PRG and
renaming the original STARTUP.PRG program. STARTUP first looks for the
file STARTUP.INF in the same directory and if it can't find it, it tries to
locate it in the main directory (ex. A:STARTUP.INF). From now on, these
three files can be the only files you need in the AUTO directory because all
other files to be executed can be located in their original drive and folder
and can even have parameters past to them. You no longer have to make sure
of the order that you copied your files to the AUTO directory because
STARTUP executes programs as they are listed in STARTUP.INF.
The format for programs to be executes is to list the complete program
name followed by any parameters to be passed. any command or program name
can be followed by a comment. Any text on a line that follows a ';' will
be treated as a comment. For example,
a:\supboot.prg ; Supra Hard Drive driver program
c:\bin\touch.prg a:startup.inf ; Update time stamp for info file
would first load the hard drive driver program supboot,prg from drive A: and
then update the time stamp for the file a:startup.inf.
There are a few unix-like commands that are used in the STARTUP.INF
file as well as some other special commands. All commands must be in lower
case, however, the file names may be in lower or upper case. The allowable
commands are as follows:
Copy Files:
cp file1 file2 - copy file1 to file2
cp file1 ... dir - copy file1 and other files to the directory dir
The cp command is useful for copying files to a ram disk. Wildcards
are also accepted.
cp b:\src\*.c c:\ ; Copy source files to ram disk c:
Renaming files:
mv oldfile newfile
The mv command renames the file oldfile to the name newfile.
Remove files:
rm file ...
The rm command removes the listed files. As with cp, wild cards are
also accepted. Be careful, though, about doing an rm *.*
so you don't wipe out a disk by accident.
Create directory
mkdir dir ...
The mkdir command creates the subdirectory dir.
Remove directories
rmdir dir ...
The rmdir command removes the specifies subdirectories. An error will
occur if the specified subdirectory is not empty or does not exist.
Display files:
cat file ...
The cat command displays the listed files on the console. Useful for
displaying any title screen information. Once again, wild cards are
accepted. Pressing ctrl-C during the display of a file aborts displaying
that file and goes on to the next file if there is one.
Change directory:
cd dir
The cd command changes the default directory to either a disk drive or
a subdirectory.
cd b: ; changes default drive to b:
cd b:\auto ; change to drive b:, subdirectory auto
The cd command is useful if when running programs you don't want to list
the complete file name (drive and directory) and if the program being
executed expects to find certain files (data files) in the default
directory.
Display text:
echo [-in] [-x xpos] [-y ypos] string
The echo command displays the following string (list of words) on the
screen followed by a carriage return. If the -n option is used, the
carriage return is not printed. If the -i option is used, the string
is printed in inverse video. The -x option will position the cursor at
column xpos and the -y option will position the cursor at line ypos.
The echo command is useful for displaying what is happening at
different points of the boot process.
As an example, I use the following:
echo -n The time is
c:\bin\date.prg ; display the current time
This will display: The time is Sat Jan 24 1987 12:24pm
Setting variables
set var = string - set variable var to string
set var = $< - set variable var to a string entered from keyboard
set var = $<< - set variable var to one character from keyboard
set - display all variables
The set command allows the user to set up to 20 variables whose variable
names can be up to 8 characters in length. If string is to be more than
than one word then it should be in quotes, e.g. "This is a string". If
the string is $<, then the variable waits for a string to be entered from
the keyboard. If the string is $<<, then the variable waits for a single
key to be hit on the keyboard. This string can then be tested later using
the if command. Using set without any arguments will display all of the
variables and the string values associated with them.
Accessing variables
To get the value of a string, a $ is placed in front of the name, for
example:
set test = "This is a test"
echo $test
This will display the value of variable test.
Variables representing file names can also have suffixes. The suffixes
supported by STARTUP are:
:h - head - returns path name of file
:t - tail - returns file name without path name
:r - root - returns file name without extension
:e - extension - returns file name extension
For example:
set file=c:\startup\startup.prg
echo $file:h => c:\startup
echo $file:t => startup.prg
echo $file:r => c:\startup\startup
echo $file:e => prg
Conditional statements
if (expression) then
commands
endif
if (expression) then
commands
else
commands
endif
The if command is used to test the validity of the specified
expression. If the expression is true, the commands following the
then statement will be executed. An optional else statement can be
used if the expression is false. The if command must end with the
endif statement. There can be as many as 9 nested if statements,
however be sure that there are enough endif statements to match them.
The expression has two forms. They are:
(string1 condition string2)
(option file name)
In the first form, string1 and string2 can be either strings or variables.
The possible conditions are as follows:
== is equal to
!= is not equal to
< is less than
> is greater than
<= is less than or equal to
>= is greater than or equal to
An example of this form of the if command would be:
echo -n Enter your name
set name = $<
if ($name == Murray) then
echo Sysop Murray is on-line
endif
In the second form of the expression, option has the following values:
-e - existence - does the file exist?
-d - directory - is the file a subdirectory?
-f - normal - is the file not a directory?
-w - writeable - is the file writeable (not write protected)?
-z - zerosize -